"""
封装用户管理模块
"""

from zonghe.caw.base_request import BaseRequest


def register(url, test_request, cs):
    """
    :param url: 测试环境
    :param test_request: BaseRequest的实例
    :param cs:  请求参数
    :return: 注册接口的响应
    """
    url = url + "/futureloan/mvc/api/member/register"
    r = test_request.post(url, data=cs)
    return r


def login(url, test_request, cs):
    """
    :param url: 测试环境
    :param test_request: BaseRequest的实例
    :param cs:  请求参数
    :return: 登录接口的响应
    """
    url = url + "/futureloan/mvc/api/member/login"
    r = test_request.post(url, data=cs)
    return r


def recharge(url, test_request, cs):
    """
    :param url: 测试环境
    :param test_request: BaseRequest的实例
    :param cs:  请求参数
    :return: 充值接口的响应
    """
    url = url + "/futureloan/mvc/api/member/recharge"
    r = test_request.post(url, data=cs)
    return r


if __name__ == '__main__':
    register("http://192.168.151.6:8080", BaseRequest(), {"mobilephone": "", "pwd": 123456})
